# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'budgetanalizer.ui'
#
# Created: Mon May 14 10:30:20 2012
#      by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
from pl.edu.budgetanalizer.GUI import loginWidget
from pl.edu.budgetanalizer.GUI.databaseManagment import DatabaseManagment
from pl.edu.budgetanalizer.GUI.notesManagment import DayWidget
from pl.edu.budgetanalizer.GUI.raportsManagment import MonthRaport2, DayRaport, \
    WeryfRaport



try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class Ui_BudgetAnalizer(object):
    
    login = ""
    password = ""
    databaseDir = 'DRIVER={SQL Server};SERVER=MAGDAK\SQLEXPRESS;DATABASE=Baza;Trusted_Connection=yes'
    
    def showDayWidget(self, date):
        if self.login <> "":
            self.dayWidget = DayWidget.Ui_dayWidget(self.centerWigget)
            self.dayWidget.setupUi(self.dayWidget,self.calendar.selectedDate(),self.databaseDir,self.login)
            self.dayWidget.setGeometry(QtCore.QRect(0, 0, 461, 511))
            self.dayWidget.setAutoFillBackground(True)
            self.dayWidget.show()
        
    def showMonthRaport(self):
        if self.login <> "":
            self.monthWidget = MonthRaport2.Ui_Form(self.centerWigget)
            self.monthWidget.setupUi(self.monthWidget,self.calendar.selectedDate(),self.databaseDir)
            self.monthWidget.setGeometry(QtCore.QRect(0, 0, 461, 511))
            self.monthWidget.setAutoFillBackground(True)
            self.monthWidget.show()
        
    def showDayRaport(self):
        print self.login
        if self.login <> "":
            self.dayRaportWidget = DayRaport. Ui_DayRaport(self.centerWigget)
            self.dayRaportWidget.setupUi(self.dayRaportWidget,self.calendar.selectedDate(),self.databaseDir)
            self.dayRaportWidget.setGeometry(QtCore.QRect(0, 0, 461, 511))
            self.dayRaportWidget.setAutoFillBackground(True)
            self.dayRaportWidget.show()
            
    def showWeryfRaport(self):
        if self.login <> "":
            self.weryfRaporthWidget = WeryfRaport.Ui_WeryfRaport(self.centerWigget)
            self.weryfRaporthWidget.setupUi(self.weryfRaporthWidget,self.calendar.selectedDate(),self.databaseDir)
            self.weryfRaporthWidget.setGeometry(QtCore.QRect(0, 0, 461, 511))
            self.weryfRaporthWidget.setAutoFillBackground(True)
            self.weryfRaporthWidget.show()
        
    def showDatabaseManagment(self):
        if self.login <> "":
            self.databaseManagment = DatabaseManagment.Ui_Form(self.centerWigget)
            self.databaseManagment.setupUi(self.databaseManagment,self.databaseDir)
            self.databaseManagment.setGeometry(QtCore.QRect(0, 0, 461, 511))
            self.databaseManagment.setAutoFillBackground(True)
            self.databaseManagment.show() 
            
    def showLoginWidget(self):
        self.loginWidget = loginWidget.Ui_Form(self.centerWigget)
        self.loginWidget.setupUi(self.loginWidget,self.databaseDir,self)
        self.loginWidget.setGeometry(QtCore.QRect(0, 0, 461, 511))
        self.loginWidget.setAutoFillBackground(True)
        self.loginWidget.show() 
        
    '''
        wygenerowane gui
    '''
    def setupUi(self, BudgetAnalizer):
        self.BudgetAnalizer = BudgetAnalizer
        self.BudgetAnalizer.setObjectName(_fromUtf8("BudgetAnalizer"))
        self.BudgetAnalizer.resize(711, 564)
        self.centralWidget = QtGui.QWidget(self.BudgetAnalizer)
        self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
        
        self.menuFrame = QtGui.QFrame(self.centralWidget)
        self.menuFrame.setGeometry(QtCore.QRect(460, 0, 241, 511))
        self.menuFrame.setFrameShape(QtGui.QFrame.Panel)
        self.menuFrame.setObjectName(_fromUtf8("menuFrame"))
        
        self.calendar = QtGui.QCalendarWidget(self.menuFrame)
        self.calendar.setGeometry(QtCore.QRect(10, 10, 216, 155))
        self.calendar.setObjectName(_fromUtf8("calendar"))
        self.calendar.clicked[QtCore.QDate].connect(self.showDayWidget)

        self.verticalLayoutWidget = QtGui.QWidget(self.menuFrame)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 170, 211, 321))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.menuButtons = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.menuButtons.setMargin(0)
        self.menuButtons.setObjectName(_fromUtf8("menuButtons"))
        self.dailyRaportButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.dailyRaportButton.setMinimumSize(QtCore.QSize(0, 50))
        self.dailyRaportButton.setObjectName(_fromUtf8("dailyRaportButton"))
        self.dailyRaportButton.connect(self.dailyRaportButton, QtCore.SIGNAL("clicked()"),self.showDayRaport)
        self.menuButtons.addWidget(self.dailyRaportButton)
        self.monthRaportButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.monthRaportButton.setMinimumSize(QtCore.QSize(0, 50))
        self.monthRaportButton.setObjectName(_fromUtf8("monthRaportButton"))
        self.monthRaportButton.connect(self.monthRaportButton, QtCore.SIGNAL("clicked()"),self.showMonthRaport)
        self.menuButtons.addWidget(self.monthRaportButton)
        self.verificationRaportButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.verificationRaportButton.setMinimumSize(QtCore.QSize(0, 50))
        self.verificationRaportButton.setObjectName(_fromUtf8("verificationRaportButton"))
        self.verificationRaportButton.connect(self.verificationRaportButton, QtCore.SIGNAL("clicked()"),self.showWeryfRaport)
        self.menuButtons.addWidget(self.verificationRaportButton)
        self.databaseManagmentButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.databaseManagmentButton.setMinimumSize(QtCore.QSize(0, 50))
        self.databaseManagmentButton.setObjectName(_fromUtf8("databaseManagmentButton"))
        self.databaseManagmentButton.connect(self.databaseManagmentButton, QtCore.SIGNAL("clicked()"),self.showDatabaseManagment)
        self.menuButtons.addWidget(self.databaseManagmentButton)
     
        
        self.centerWigget = QtGui.QWidget(self.centralWidget)
        self.centerWigget.setGeometry(QtCore.QRect(0, 0, 461, 511))
        self.centerWigget.setObjectName(_fromUtf8("centerWigget"))
        
        BudgetAnalizer.setCentralWidget(self.centralWidget)
        self.menuBar = QtGui.QMenuBar(BudgetAnalizer)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 711, 21))
        self.menuBar.setObjectName(_fromUtf8("menuBar"))
        self.menuMenu = QtGui.QMenu(self.menuBar)
        self.menuMenu.setObjectName(_fromUtf8("menuMenu"))
        self.menuAutors = QtGui.QMenu(self.menuBar)
        self.menuAutors.setObjectName(_fromUtf8("menuAutors"))
        BudgetAnalizer.setMenuBar(self.menuBar)
        self.mainToolBar = QtGui.QToolBar(BudgetAnalizer)
        self.mainToolBar.setObjectName(_fromUtf8("mainToolBar"))
        BudgetAnalizer.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)
        self.statusBar = QtGui.QStatusBar(BudgetAnalizer)
        self.statusBar.setObjectName(_fromUtf8("statusBar"))
        BudgetAnalizer.setStatusBar(self.statusBar)
        self.actionAuthors = QtGui.QAction(BudgetAnalizer)
        self.actionAuthors.setObjectName(_fromUtf8("actionAuthors"))
        self.menuAutors.addAction(self.actionAuthors)
        self.menuBar.addAction(self.menuMenu.menuAction())
        self.menuBar.addAction(self.menuAutors.menuAction())

        self.retranslateUi(BudgetAnalizer)
        QtCore.QMetaObject.connectSlotsByName(BudgetAnalizer)
        
        self.showLoginWidget()

    '''
        wygenerowane gui
    '''
    def retranslateUi(self, BudgetAnalizer):
        BudgetAnalizer.setWindowTitle(QtGui.QApplication.translate("BudgetAnalizer", "BudgetAnalizer", None, QtGui.QApplication.UnicodeUTF8))
        self.dailyRaportButton.setText(QtGui.QApplication.translate("BudgetAnalizer", "Stwórz raport dzienny", None, QtGui.QApplication.UnicodeUTF8))
        self.monthRaportButton.setText(QtGui.QApplication.translate("BudgetAnalizer", "Stwórz raport miesięczny", None, QtGui.QApplication.UnicodeUTF8))
        self.verificationRaportButton.setText(QtGui.QApplication.translate("BudgetAnalizer", "Stwórz raport weryfikacyjny", None, QtGui.QApplication.UnicodeUTF8))
        self.databaseManagmentButton.setText(QtGui.QApplication.translate("BudgetAnalizer", "Zarządzaj bazą produktów", None, QtGui.QApplication.UnicodeUTF8))
        self.menuMenu.setTitle(QtGui.QApplication.translate("BudgetAnalizer", "Menu", None, QtGui.QApplication.UnicodeUTF8))
        self.menuAutors.setTitle(QtGui.QApplication.translate("BudgetAnalizer", "About", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAuthors.setText(QtGui.QApplication.translate("BudgetAnalizer", "Authors", None, QtGui.QApplication.UnicodeUTF8))

